package com.gzx.asr.modular.funasr.controller;

import com.gzx.asr.modular.funasr.service.FunAsrJobService;
import com.gzx.asr.modular.media.vo.GzxHtCallReceiptBusinessVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.pojo.CommonResult;

import java.util.List;

/**
 * @author xbl
 */
@RestController
@RequestMapping("/feign/funasr")
public class GzxAsrVoiceTextController {

    private final FunAsrJobService jobService;

    public GzxAsrVoiceTextController(FunAsrJobService jobService) {
        this.jobService = jobService;
    }

    //语音转文字
    @RequestMapping("/voiceToText")
    public String voiceToText(@RequestBody List<GzxHtCallReceiptBusinessVo> urlList) {
        jobService.voiceToText(urlList);
        return "成功";
    }

    /**
     * 测试批量调用
     */
    @GetMapping("/test")
    public CommonResult<String> list() {
        jobService.voiceToTextJob();
        return CommonResult.data("成功");
    }
}
